﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;

namespace ReportingManager
{
    public class Database
    {
        static string ConnStr = ConfigurationManager.ConnectionStrings["Db"].ConnectionString;
        public static object DataSender(string query)
        {
            DataTable dt = new DataTable();
            using (SqlConnection sql = new SqlConnection(ConnStr))
            {
                sql.Open();
                using (SqlDataAdapter da = new SqlDataAdapter(query, sql))
                {
                    da.SelectCommand.CommandTimeout = int.MaxValue;
                    da.Fill(dt);
                }
                sql.Close();
            }
            return dt;
        }
    }
}
